package com.jishuo.nontax.view.controller;

import com.jishuo.base.bean.BaseResult;
import com.jishuo.base.bean.vo.UserVO;
import com.jishuo.nontax.bean.vo.StudentVO;
import com.jishuo.nontax.bfc.service.StudentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * @author hlp
 * @date 2023/3/30 10:43
 * @Description: 学校缴费
 */
@Slf4j
@Controller
@RequestMapping(value = "/view/student", name = "学校缴费")
public class StudentViewController {

    private String prefix = "view/";
    @Resource
    private StudentService studentService;

    @RequestMapping(value = {"studentview"}, name = "化解专户柜面")
    public String index() {
        return prefix + "studentview";
    }

    @ResponseBody
    @RequestMapping(value={"/querystudentview"})
    public BaseResult querystudentview(String billnum) {
        return studentService.getStudentVO(billnum);
    }

    @ResponseBody
    @RequestMapping(value={"/studentpayview"})
    public BaseResult studentpayview(StudentVO studentVO, HttpSession session) {
        UserVO user = (UserVO) session.getAttribute("login_user");
        studentVO.setBankstation(user.getBankStationName());
        return studentService.studentpayview(studentVO);
    }


}
